import os
import time
import pytest
import shutil

if __name__ == '__main__':
    pytest.main()
    # 复制environment.xml环境设置到allure报告
    shutil.copy('./environment.xml', './report/temps')
    # 等待3s
    time.sleep(3)
    # 将report/temps文件夹下临时生成的json格式的测试报告，-o：输出到report/allures目录下生成index.html报告
    os.system("allure generate ./report/temps -o ./report/allures --clean")
    # 启动allure服务，打开报告
    # os.system('allure serve ./report/temps')
